/**
 * Created by Administrator on 2015/11/7 0007.
 */


var DB = require("../server/CRUD");
DB = new DB("test");

exports.register = function (app) {
    app.get("/test", function (req, res, next) {
        _user = new User({
            name: "test",
            password: "123"
        });
        _user.save(function (err, user) {
        });
        User.find({}, function (list) {
            console.log(list);
        })
    })
    app.get("/test2", function (req, res, next) {
        _movie = new Video({
            link: "test",
            title: "123"
        });
        _movie.save(function (err, movie) {
        });
        Video.find({}, function (list) {
            console.log(list);
            res.json(list);
        })
    })
    app.get("/test3", function (req, res, next) {
        test = {
            aa: 11,
            aa: 11,
            bb: 232
        }
        console.log(test)
        DB.read(test, function (item) {
            res.json(item);
        })
    })
}